home *** CD-ROM | disk | FTP | other *** search
- Path: doc.ic.ac.uk!not-for-mail
- From: njs3@doc.ic.ac.uk (Niall Smart)
- Newsgroups: comp.sources.wanted,comp.lang.c,comp.unix.programmer
- Subject: Re: Seek unix2dos.c OR help with tr
- Date: 18 Mar 1996 19:45:13 -0000
- Organization: Dept. of Computing, Imperial College, University of London, UK.
- Distribution: world
- Message-ID: <4ikeg9$f7d@oak73.doc.ic.ac.uk>
- References: <4i0946$7io@nuke.csu.net> <4i0c31$r1g@solutions.solon.com>
- Reply-To: njs3@doc.ic.ac.uk (Niall Smart)
- NNTP-Posting-Host: oak73.doc.ic.ac.uk
- X-Newsreader: mxrn 6.18-23
-
-
- In article <4i0c31$r1g@solutions.solon.com>, seebs@solutions.solon.com (Peter Seebach) writes:
- |
- |>>#include <stdio.h>
- |>>main(){
- |>>char c;
- |>>while(EOF!=(c=getchar())){
- |>
- |>
- |>ARGH!!!
- |>
- |>How many times must this be said?
-
- Until the C library makers replace getchar with getint of ppl start to
- use better function interfaces: i.e.
-
- #define TRUE 1
- #define FALSE 0
-
- typedef int bool
-
- bool fGetChar(char *ch)
- {
- int i;
-
- if ((i = getchar()) != EOF)
- {
- *ch = i;
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
-
- Niall
-